#include<stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

#define NUM 102
#define TOP 100
#define STYLE '='
#define RIGHT '>'
const char* lable="|/-\\";

void ProcessBar()
{
  char bar[NUM];
  memset(bar,'\0',sizeof(bar));
  int cnt=0;
  int len=strlen(lable);
  while(cnt<=TOP)
  {
    printf("[%-100s][%d%%][%c]\r",bar,cnt,lable[cnt%len]);
    fflush(stdout);
    bar[cnt++]=STYLE;
    if(cnt<100) bar[cnt]=RIGHT;
    usleep(50000);
  }
  printf("\n");

}

int main()
{
  ProcessBar();
  
  return 0;
}
